home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 6 / CU Amiga Magazine's Super CD-ROM 06 (1996)(EMAP Images)(GB)(Track 1 of 4)[!][issue 1997-01].iso / cucd / online / fidonetts / fsc-0084.001 < prev    next >
Text File  |  1995-09-03  |  66KB  |  1,487 lines

  1.  
  2.   | Document: FSC-0084
  3.   | Version:  001
  4.   | Date:     03 September 1995
  5.   |
  6.   | Denis Bider, FidoNet#2:380/129.0
  7.  
  8. /*
  9.  
  10. Document: Electronic Data Exchange standard level 1
  11. File: EDX1.TXT
  12. Purpose: a straight-forward data exchange standard with space to expand
  13. Author: denis bider, ofs->FidoNet#2:380/129.0
  14.  
  15.  
  16. Copyright (C) 1994-1995 by denis bider. See DISCLAIM.TXT.
  17. Send *any* comments to one of my addresses as listed above.
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.    ========================================================================
  32.    Introduction
  33.    ========================================================================
  34.    After a year of development and all sorts of improvements, EDX finally
  35.    achieved the state where it has nearly everything currently wanted from
  36.    a mail format. And finally, it is being released into the general
  37.    public. My opinion is that it was well worth the waiting; anyway, this
  38.    is up to you to decide.
  39.  
  40.    EDX is meant as a standard for electronic cumputer networks that
  41.    exchange messages, files and similar data. What it does is to redesign
  42.    all the existing chaos from the beginning and try not to do the same
  43.    mistakes other similar standards did. It does its own work, others do
  44.    their.
  45.  
  46.    It is not necessary that EDX is better than other such standards. It
  47.    might also be the worst of all. This document will try to convince you
  48.    about neither. It will simply describe the standard from the beginning
  49.    to the end.
  50.  
  51.    Due to my relatively poor English, I may not succeed in the "easy to
  52.    understand" part, but well, you'll just have to get along with it.
  53.  
  54.    Please mail me all comments you might have.
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.    ======================================================================
  66.    Notes, definitions
  67.    ======================================================================
  68.    Null:          ASCII 0
  69.    CR:            Carriage Return (Enter) - ASCII 13
  70.    a long:        a 32-bit (4-byte) signed value.
  71.    an int:        a 16-bit (2-byte) signed value.
  72.    a char(acter): an 8-bit (1-byte) value.
  73.    a ulong:       an unsigned long.
  74.    a uint:        an unsigned int.
  75.    A subfield:    a various-length data field most commonly used
  76.                   in other data fields. Consists of a subfield ID
  77.                   (an uint), a subfield data length ("datlen")
  78.                   identifier (an ulong) and <datlen> bytes of data.
  79.                   Ie:
  80.                      ulong     datlen
  81.                      ulong     ID
  82.                      char      data[datlen]
  83.    0x<value>      value in hexadecimal (base 16).
  84.    Lowercase:     When a string or character is said to be "lowercase",
  85.                   that means that any characters between and including
  86.                   ASCII 'A'..'Z' are represented as their 'a'..'z'
  87.                   counterpart. Conversion applies to *no other characters
  88.                   in any national alphabets*.
  89.  
  90.  
  91.       * All mentioned CRCs are, as in Zmodem, 0xffffffff based
  92.       * All multi-byte items (words, longs) mentioned are
  93.         expressed in Intel format, which means least significant
  94.         bytes (LSB) being presented first. (Eg, 0xff11 should be
  95.         presented as 0x11 0xff)
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.    ======================================================================
  107.    Views
  108.    ======================================================================
  109.  
  110.  
  111.  
  112.    The network
  113.    =============
  114.    My opinion is that the most basic set of layers to which all computer
  115.    network technologies can be divided to contains the following:
  116.       1: Physical point-to-point connection layer
  117.       2: Physical network layer
  118.       3: Logical point-to-point connection layer
  119.       4: Logical network layer
  120.  
  121.    Let's explain that on the example of Fidonet, a typical over-the-phone
  122.    network technology. In this case, the physical point-to-point connections
  123.    are telephone wires; the physical network is all those point-to-point
  124.    connections combined; the logical point-to-point connections are modem
  125.    dial-up connections; and the logical network are, roughly, all those
  126.    point-to-point connections combined.
  127.  
  128.    The similar applies for, say, Internet telnet feature: the physical
  129.    point-to-point connections are the low-level connections between
  130.    Internet-connected computers, the physical network are all these
  131.    combined, and the logical connection is the telnet feature itself.
  132.    There is, of course, no logical network layer. And similarly for a
  133.    connection to a local BBS.
  134.  
  135.    EDX is a standard that defines the fourth, logical network layer.
  136.    A "Recommendations" chapter is provided in which a sample interaction
  137.    between the fourth and the third network layer is defined; however,
  138.    that chapter should not be treated as a part of EDX itself.
  139.  
  140.  
  141.  
  142.    The site
  143.    ==========
  144.    In everyday practice, I encounter many inconsistencies in how systems
  145.    are generally treated. Often, one says "BBS" meaning "mail system", or
  146.    meaning the entire site at all. So let's define these terms.
  147.  
  148.       1. The site is all the hardware, software and peopleware, and is
  149.          often referred to as "system".
  150.       2. The mail system is the part of the site that deals with networks,
  151.          with "external relations". If you're in an OFT network and run
  152.          SomeScan in combination with OtherMail, these two programs are
  153.          your mail system from the viewpoint of the network you're in.
  154.       3. The BBS is the part of the site that deals with human callers, and
  155.          has nothing to do with the part of the site called the "mail
  156.          system", except that the parts can and usually do exchange data
  157.          (messages, files).
  158.  
  159.    My opinion is that the mail system and the BBS part of a site should be
  160.    kept separated, but often that is not the case. Take QWK networks for
  161.    example, where not only the two concepts are totally mixed up, but
  162.    networks also not so rarely mess with things that are none of their
  163.    bussiness; a network as an organization should care about the systems,
  164.    not about the BBSes or even the entire sites, but that is the mistake
  165.    often done.
  166.  
  167.  
  168.    The points
  169.    ============
  170.    In networks like FidoNet, a user often installs mailing software and
  171.    becomes what is called "a point". A point system is, in EDX, treated
  172.    as any other system. Indeed, actually *every* system is a point system,
  173.    it's only that those systems that are talked about as "nodes" have a
  174.    point number of zero. See below for a disclaimer in which you will read
  175.    that in EDX, if OFT addresses are used, all fields must be present,
  176.    zero or not.
  177.  
  178.    Therefore, when an application receives or sends mail from/to a point,
  179.    the "point" system must be treated as any other system. In EDX terms,
  180.    points are full-fledged systems and that is exactly how they must be
  181.    treated; they are included in SENTTO and TRACE subfields, as well. The
  182.    limitations of a point being able to be linked to a single system (ie,
  183.    what was in former organization called "a boss") is gone and buried; as
  184.    said, EDX does not distinguish point systems from any other type of
  185.    systems. Any differences in point-system-treatment in the other parts of
  186.    a network do not affect how EDX treates them.
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.    ========================================================================
  197.    Addresses in EDX
  198.    ========================================================================
  199.    EDX uses E-Addressing for maximum compatibility with various addressing
  200.    systems and to allow independability from the addressing scheme as used
  201.    by the underlying network. However, only and exclusively site
  202.    E-Addresses are used in EDX; usage of a user E-Address in any field of
  203.    an EDX message is considered a violation of the specifications.
  204.  
  205.    The general format of a site E-Addresses is:
  206.       <format> "->" <siteaddr>
  207.  
  208.    <format> specifies the format of the <siteaddr> field. An E-Address is
  209.    assumed not to contain any whitespace. E-Addresses can or cannot be case
  210.    sensitive, depending on the contents of the <format> field; for that
  211.    matter, when passing E-Addresses, the its case should be left untouched.
  212.    For now, all known types of E-Addresses are case INsensitive.
  213.  
  214.    The following formats are recognized:
  215.  
  216.    Format identifier:    "ofs" (Traditional FTN style)
  217.    <siteaddr> format:    <netid> "#" <zone> ":" <net> "/" <node> "." <point>
  218.    Example addresses:    ofs->FidoNet#2:380/129.0
  219.    ALL ADDRESS COMPONENTS ARE REQUIRED. NO EXCEPTIONS.
  220.  
  221.    Format identifier:    "itn" (Internet e-mail style)
  222.    <siteaddr> format:    <sth> {"." <sth>}
  223.    Example addresses:    itn->f129.n380.z2.fidonet.org
  224.                          itn->ixtas.fer.uni-lj.si
  225.  
  226.    All format identifiers are and will be three characters in length.
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.    ========================================================================
  238.    The logical network layer
  239.    ========================================================================
  240.    This chapter describes the logical network layer that is independent
  241.    of the lower layers. One of the ways how to actually pass what is
  242.    defined in this chapter from one system to another is described in the
  243.    Recommendations chapter. The reason for such separation is that EDX
  244.    is a layer 4 protocol definition exclusively, and does not want to
  245.    mix with other network layers; ie., a network must by itself choose
  246.    or define the layer 3, 2 and 1 protocols it is going to use with EDX.
  247.    However, in order to standardize EDX-related matters, a chapter with
  248.    some recommendations is provided towards the end of the document.
  249.  
  250.    The idea of the mentioned independent part of the logical network layer
  251.    is similar to the way in which messages are stored in the JAM message
  252.    base format; each message consists of a binary header for fixed-length
  253.    data and an arbitrary number of subfields that contain other, variable-
  254.    length data.
  255.  
  256.    An EDX subfield consists of, as lined out in the Notes section, a
  257.    datlen identifier, an ID and data. Subfields with an unknown ID should
  258.    be left untouched when exported to other systems.
  259.  
  260.  
  261.  
  262.  
  263.    ========================================================================
  264.    The message
  265.    ========================================================================
  266.    EDX messages differ a little from other network types' messages: in EDX,
  267.    messages need not consist of text only, or of text at all; a message can
  268.    have more than one receiver.
  269.  
  270.  
  271.    True crossposting and other goodies
  272.    ========================================================================
  273.    For quite a while at first, true crossposting (a single physical message
  274.    belonging to more than one echo) was a part of the EDX specifications.
  275.    However, it is my opinion that, in the current state of things, it would
  276.    cause much more problems than it would solve, so this "feature" has been
  277.    removed.
  278.  
  279.    Formerly present, but removed for the same reason have been Utypia-style
  280.    ROUTE directions.
  281.  
  282.  
  283.    Message header
  284.    ========================================================================
  285.    The binary message header layout follows:
  286.       char signature[8]   // Must match <E><D><X><_><M><S><G><NULL>
  287.       uint hdrlen         // The size of the header
  288.       int utcoffset       // UTC offset, *signed*; see timestamp
  289.       ulong timestamp     // Local time of message's creation
  290.       ulong subflen       // Length of the subfields that follow
  291.       ulong attribute1    // Message attributes
  292.       ulong seqno         // Message's sequential number
  293.  
  294.    hdrlen specifies the size of the header, from and including the first
  295.    byte of the signature field to and including the last byte of the last
  296.    present field. Used mainly to ensure downward compatibility for
  297.    hypothetical EDX levels higher than 1. Should an application encounter
  298.    hdrlen higher than it supports, it should only process fields up to what
  299.    it supports and skip the others. Should it encounter hdrlen lower than
  300.    it supports, it should only process fields up to <hdrlen> bytes. Note
  301.    that the hdrlen field cannot be just arbitrarily picked! When creating
  302.    a header, always include the whole contents of the highest header
  303.    revision you support; otherwise, it is perfectly allright for a
  304.    processing application to dismiss the message in its entirety.
  305.  
  306.    timestamp contains the local date and time when the message has been
  307.    written, or if that information isn't available, when it joined network
  308.    flow. It is expressed as the number of seconds elapsed since 00:00:00,
  309.    January 1st 1970; the time should be (= must be) represented in UTC.
  310.  
  311.    The UTC offset of the site that generated timestamp as described above
  312.    is stored in the utcoffset field. Eg: if the UTC offset is -0230, the
  313.    utcoffset field should read, simply, -230; +0200 => 200; and so forth.
  314.  
  315.    The seqno field is the message's sequential number. For each area an
  316.    EDX system is linked to, it maintains the number of messages it exported
  317.    from that area. When the next message is exported, that number is
  318.    incremented by 1 and is also assigned to the message as its serial
  319.    number. The main use of this serial number is that one can quickly see
  320.    if they received all the messages from a particular system in a
  321.    particular area, and if they didn't, messages are getting lost
  322.    somewhere. This serial number might also be used as means of dupe-link
  323.    detection, but however, if the serial numbers of two messages don't
  324.    match, one of them can still be a dupe of the other; the system might
  325.    have exported the message twice. Therefore, you should stick to the
  326.    msgid header field for duplicate message checking; the serial numbers of
  327.    duplicate messages can be used to determine the cause of duplication.
  328.  
  329.  
  330.  
  331.  
  332.    Message attributes
  333.    ========================================================================
  334.    The following bits for attribute1 are defined:
  335.  
  336.       HasFiles   0x01L  The message has files attached
  337.       IsReply    0x02L  The message is a reply
  338.       ReceiptRq  0x04L  (netmail messages only) A return receipt should
  339.                         be generated for the message when it is received
  340.                         by the destination system.
  341.       ConfirmRq  0x08L  (netmail only) A return receipt should be generated
  342.                         for the message when it is read by each of its
  343.                         addressees.
  344.       IsReceipt  0x10L  (netmail only) The message is a return receipt.
  345.       Echoed     0x20L  If set, the message contains an ECHO subfield.
  346.                         If not set, the message contains a DEST subfield.
  347.  
  348.    Other bits should be set to 0.
  349.  
  350.    IsReceipt cannot be set in combination with ReceiptRq and/or ConfirmRq.
  351.  
  352.  
  353.  
  354.    Subfields
  355.    ========================================================================
  356.    A short list of subfields and their IDs:
  357.    DEST (0), ORIGIN (1), AUTHOR (2), ECHO (3), WHOTO (4), TRACE (5),
  358.    CHARSET (6), SUBJECT (7), CREATOR (8), EXPORTER (9), SENTTO (10),
  359.    MSGID (11), REPLYID (12), TEXT (1000), FILE (1001)
  360.  
  361.    Each subfield is an independent unit on itself. However, for the sake of
  362.    easier producing of simpler and more readable EDX handling code, two
  363.    major types of subfields are recognized, "simple" and "complex".
  364.  
  365.    The "simple" subfields are simply subfields that have a maximum lenght
  366.    of 100 characters. They usually contain a stream of textual characters.
  367.  
  368.    Please note that if a simple subfield contains text, it is *not*
  369.    null-terminated. Its length is to be determined by the "datlen"
  370.    identifier in the subfield header. As said, the maximum length for
  371.    simple subfields is 100 characters; all data beyond the 100th character
  372.    can be ignored. Simple subfields have IDs ranging within 0..999.
  373.  
  374.    The "complex" subfields are all other subfields. Their maximum size
  375.    and other attributes are specific for each of them. Their IDs range
  376.    from 1000 on.
  377.  
  378.    Note: read what subfield descriptions say. If, for example, the Presence
  379.          field says "exactly one", that means that *exactly one* subfield
  380.          of this type should be inserted in the message, no more, no less.
  381.          The same applies for other fields and as well to everything else
  382.          in the document.
  383.  
  384.  
  385.  
  386.    SUBFIELD: DEST (simple)
  387.    ID: 0
  388.    Presence: Either one DEST subfield or one ECHO subfield
  389.  
  390.    The DEST subfield stores the address of the system to route the message
  391.    to. It is up to the systems that are passing the message to decide if
  392.    and how to actually route the message there.
  393.  
  394.    For historical reasons, messages with a DEST subfield are called
  395.    "netmail". Messages with an ECHO subfield are called "echomail".
  396.    A netmail message is considered private between its authors and its
  397.    addressees.
  398.  
  399.  
  400.  
  401.    SUBFIELD: ORIGIN (simple)
  402.    ID: 1
  403.    Presence: Exactly one
  404.  
  405.    Contains:
  406.       * the E-Address of the system that generated the message
  407.       * a NULL character
  408.       * the name of the person that wrote the message
  409.  
  410.    Gating: see Origin supplementary line. Also, as opposed to, for example,
  411.       FidoNet, the gating system does not insert its own address in the
  412.       ORIGINADDRESS subfield when a message is gated to EDX, but instead
  413.       converts the original origination address to E-Address format and
  414.       puts it here. The address of the gating system itself is stored as a
  415.       part of a gated TRACE subfield. (See TRACE subfield)
  416.  
  417.  
  418.  
  419.    SUBFIELD: AUTHOR (simple)
  420.    ID: 2
  421.    Presence: Zero or more
  422.  
  423.    Format of contents:
  424.       * the E-Address of the system where the person can be reached
  425.       * a NULL character
  426.       * the name of the person
  427.  
  428.    Each AUTHOR subfield lists one of the message's authors if there are
  429.    more than one or if the message's author is not the message's physical
  430.    sender. All message's authors should be listed, any of them "residing"
  431.    in the ORIGIN subfield or not.
  432.  
  433.    Gating to network formats that only support sender name (like QWK or
  434.    OFT): use Author supplementary lines.
  435.  
  436.  
  437.  
  438.    SUBFIELD: ECHO (simple)
  439.    ID: 3
  440.    Presence: Either an ECHO subfield or a DEST subfield
  441.  
  442.    The subfield specifies the name of the echo area to which the message
  443.    has been posted. The contents of the ECHO subfield should be treated
  444.    case insensitive. For the echo area name, all characters between from
  445.    ASCII 33 to 126 are allowed, with the exception that '-', '+' and '%'
  446.    must not be the first characters of the area name and that '*' and '?'
  447.    must not be present at all.
  448.  
  449.    If there is no DEST or ECHO subfield in a message, the message should be
  450.    shown to the sysop and its distribution among systems stopped.
  451.  
  452.    An echoed message is considered public.
  453.  
  454.  
  455.  
  456.    SUBFIELD: WHOTO (simple)
  457.    ID: 4
  458.    Presence: Zero or more
  459.  
  460.    Each WHOTO subfield specifies a name of a person whose attention should
  461.    be drawn to the message. The WHOTO subfield is, by its function, very
  462.    much the same as To: lines in FidoNet and similar networks, except that
  463.    EDX allows more than one message's addressee. (.. by allowing multiple
  464.    WHOTO subfields to be present)
  465.  
  466.    If an WHOTO subfield is not present in a message with an ECHO subfield,
  467.    the message should be assumed of equal importance to everybody. (Ie, the
  468.    same as "To: All" in the analogy above)
  469.  
  470.    If no WHOTO subfield is present in a message with a DEST subfield, the
  471.    message is assumed to be addressed to the operator of the system it is
  472.    destined to.
  473.  
  474.    Gating to networks that don't support as many message addressees as the
  475.       gated message has: use Whoto supplementary lines.
  476.  
  477.  
  478.  
  479.    SUBFIELD: TRACE (simple)
  480.    ID: 5
  481.    Presence: Exactly one
  482.  
  483.    There are three formats for a TRACE subfield, "prevnet", "gated" and
  484.    "native". The gated and prevnet formats are used only when converting
  485.    a message from a parallel format to EDX and should not be used
  486.    otherwise.
  487.  
  488.    The prevnet format reads:
  489.       "<= <text-of-parallel-trace-information>"
  490.    It is used to store TRACE information of the previous network.
  491.  
  492.    The gated format reads:
  493.       "++ <time>, <site E-Address>, <progname>, from: <prev net fmt>"
  494.    It is used to signify that a message has been gated from a network and
  495.    is inserted by the gating program. See the native format for a
  496.    description of the mentioned gated entry fields.
  497.  
  498.  
  499.    Each EDX-compliant system, when exporting a message to other systems,
  500.    must add its TRACE subfield of "native" type to the message, and it
  501.    should do that so that all previously existant TRACE subfields are
  502.    listed *before* the added TRACE subfield. This is essential: the order
  503.    of TRACE subfields must always be kept when passing the message to other
  504.    systems.
  505.  
  506.    No more than one native TRACE subfield may be appended. Also, prior to
  507.    exporting a message, the native TRACE subfields should be checked upon
  508.    the presence of our E-Address, and if positive (a TRACE subfield with
  509.    our address is already present), the message should not be processed.
  510.    An exception to this rule is only made if the native entry is the last
  511.    in the list; in this case, the message should be forwarded to other
  512.    systems, but another native entry should not be added to the TRACE
  513.    subfield.
  514.  
  515.    If a system holds multiple addresses, only one of them should be written
  516.    to the TRACE subfield, but all of them should be checked when checking
  517.    if the message was already processed by the system.
  518.  
  519.    The format of the native TRACE subfield entry is:
  520.       ".. <time>, <site E-Address>, <program id>"
  521.  
  522.    where ".." are indeed two periods (dots), <program id> should contain
  523.    the name and version of the program that added the subfield entry and
  524.    not exceed 25 characters, whereas <time> is the time when message was
  525.    processed by the system whose site address is specified in
  526.    <site E-Address>. Timestamp format is:
  527.  
  528.       YYMMDD HHmm sUUUU
  529.  
  530.    where:
  531.  
  532.    (all components of the timestamp are null-padded to their full length)
  533.  
  534.       YY is the last two digits of the year
  535.       MM is the month
  536.       DD is the day
  537.       HH is the hour
  538.       mm is the minute
  539.       s is the sign for UUUU (either + or -)
  540.       UUUU is the UTC offset of the system that generated
  541.          the timestamp
  542.  
  543.    The YYYYMMDDHHmm part corresponds to the local time of the site. For
  544.    example, 7th November 2007, 13:57, UTC offset 0200 positive:
  545.       071107 1357 +0200
  546.  
  547.    Gating in general: the gating program should always add a "gated" TRACE
  548.       subfield together with other TRACE subfields it created when gating
  549.       the message.
  550.    OFT gating: for ROUTE-ed (netmail) messages, the TRACE subfield is
  551.       parallel to the Via kludge; when gated to OFT, the information from
  552.       TRACE should be mirrored to Via, while when gated to EDX, the
  553.       information from Via (without the "^Via: " prefix) should be mirrored
  554.       to TRACE subfields using the prevnet entry format. If any mirrored
  555.       Via line information is prefixed with "EDX<= ", "EDX++ " or "EDX.. ",
  556.       the "EDX" pre-prefix should be removed and the "<= " prefix not added.
  557.  
  558.       For echoed messages, the TRACE subfield is not to be gated.
  559.  
  560.       Puzzled? Study the below example:
  561.  
  562. <TRACE> .. 970101 1300 +1200, ofs->FidoNet#2:380/129.0, StupiToss v1.23
  563. <TRACE> .. 970101 1330 +1200, ofs->FidoNet#2:380/100.0, SmarToss v2.34
  564.  
  565.       Gated to OFT:
  566.  
  567. ^AVia: EDX.. 970101 1300 +1200, ofs->FidoNet#2:380/129.0 StupiToss v1.23
  568. ^AVia: EDX.. 970101 1330 +1200, ofs->FidoNet#2:380/100.0, SmarToss v2.34
  569. ^AVia: FidoNet#2:345/678.0 SnailConvert  Mon, 30 Feb 00 at 24:61
  570.  
  571.       Gated back to EDX:
  572. <TRACE> .. 970101 1300 +1200, xyz.m-art.fido, StupiToss v1.23
  573. <TRACE> .. 970101 1330 +1200, m-art.fido, SmarToss v2.34
  574. <TRACE> <= FidoNet#2:345/678.0 SnailConvert  Mon, 30 Feb 1999 at 24:61
  575. <TRACE> ++ 970112 2001 +3456, ofs->FidoNet#3:456/789.0, WMail v3.45, from: OFT
  576. <...>
  577.  
  578.    Gating for networks with similar TRACE control: see OFT gating.
  579.       Of course, if the destination network format supports TRACE
  580.       information in echoed messages, it should be used.
  581.    Converting to JAM: forget JAM's internal format and use the EDX's
  582.       "international" format as described above, ie. "EDX.. <...>",
  583.       "EDX<= <...>" and "EDX++ <...>".
  584.  
  585.  
  586.  
  587.    SUBFIELD: CHARSET (simple)
  588.    ID: 6
  589.    Presence: Exactly one
  590.  
  591.    Contains the name of the character set that was used when writing the
  592.    message if not LATIN-1. People of each country should settle on a few
  593.    commonly-used character sets and their ID strings for the EDX CHARSET
  594.    subfield; in Slovenia, for example, this subfield will usually contain
  595.    "CP852", while for, say, the USA, it will probably always contain
  596.    "CP437".
  597.  
  598.  
  599.    SUBFIELD: SUBJECT (simple)
  600.    ID: 7
  601.    Presence: Zero or one
  602.  
  603.    The SUBJECT subfield should contain a short description of what the
  604.    message's text is about.
  605.  
  606.    When gating a message, if the subject is longer than what is supported
  607.    by the destination network format, the Subject supplementary line should
  608.    be used. (See next chapter)
  609.  
  610.  
  611.    SUBFIELD: CREATOR (simple)
  612.    ID: 8
  613.    Presence: Zero or one
  614.  
  615.       The subfield contains the name of the program with which the message
  616.       was originally written. Should be omitted if the used program is
  617.       the same that created the packet. The stated rule may or may not
  618.       apply if the CREATOR and EXPORTER programs are different, but from
  619.       the same package.
  620.  
  621.       Gating for network formats that do not feature anything parallel to
  622.          the CREATOR subfield: use the Creator supplementary line.
  623.       OFT Gating: when exporting to, use Creator supplementary line
  624.          because of PID restrictions. However, when importing from, PID
  625.          should be converted to CREATOR.
  626.  
  627.  
  628.    SUBFIELD: EXPORTER (simple)
  629.    ID: 9
  630.    Presence: Zero or one
  631.  
  632.       The subfield contains the name of the program that entered the
  633.       message into network flow. Should be omitted if the used program is
  634.       the same that created the packet. The stated rule may or may not
  635.       apply if the CREATOR and EXPORTER programs are different, but from
  636.       the same package.
  637.  
  638.       Gating for network formats that do not feature anything parallel to
  639.          the EXPORTER subfield: use the Exporter supplementary line.
  640.       OFT Gating: when exporting to, use Exporter supplementary line
  641.          because of TID restrictions. However, when importing from, TID
  642.          should be converted to EXPORTER.
  643.  
  644.  
  645.  
  646.    SUBFIELD: SENTTO (simple)
  647.    ID: 10
  648.    Presence: Exactly one with ECHO subfields, none with DEST
  649.  
  650.    The SENTTO subfield contains from 1 to 25 ulongs.
  651.  
  652.    The SENTTO subfield is intended to provide means for implementations
  653.    of fully connected poligons (networks or parts of networks where all
  654.    participating systems send mail directly to all other systems). Each
  655.    ulong in the SENTTO subfield should contain a 32-bit CRC of the
  656.    E-Address of one of the systems to which the previous system in chain
  657.    has exported the message in which the SENTTO subfield appears. The
  658.    all-lower-case representation of the E-Address should be used when
  659.    calculating the CRC. If a CRC of one system's E-Address is already
  660.    included in the SENTTO field of a message, that message should not be
  661.    sent to that system again. Each system should, when exporting a message
  662.    to another system, create a *new* SENTTO subfield with CRCs of addresses
  663.    of systems to which the system is sending the message now.
  664.  
  665.    The SENTTO subfield is mandatory in messages with one or more ECHO
  666.    subfields, but should not be included in messages with DEST subfields.
  667.  
  668.    Gating: always removed when gated.
  669.  
  670.  
  671.  
  672.    SUBFIELD: MSGID (simple)
  673.    ID: 11
  674.    Presence: Exactly one
  675.  
  676.    The MSGID subfield contains text that represents the string assigned to
  677.    the message by the system it was sent from. When the MSGID has been
  678.    created on an EDX-compliant system, its format should be:
  679.       <hexno1><hexno2><hexno3>
  680.       All of them are numbers in hexadecimal notation, the first two padded
  681.       to 8 characters, the third padded to 4 characters in length, with no
  682.       separator characters (whitespace, for example) to be inserted in
  683.       between. <hexno1> is the 32-bit CRC of message text, the algorythm is
  684.       the same as used in ZModem; <hexno2> contains a 32-bit sum of all
  685.       characters in message text (that is, for i = 1 to textlen do value =
  686.       value + character), first initialized to zero; <hexno3> contains the
  687.       16-bit CRC of message text, and the algorythm is the same as used in
  688.       XModem.
  689.  
  690.    The MSGID should *never* be changed when the message is already being
  691.    distributed. Note that at no point should this information serve as
  692.    means to check if the message text has been passed ok; a processing
  693.    application should always treat the MSGID field to be in an unknown
  694.    format. However, the MSGID subfield is assumed not to contain
  695.    unprintable characters, that is, it should always contain characters
  696.    between and including ASCII 32..126.
  697.  
  698.    Gating: when converting to another message format, always use the MsgID
  699.       subfield to store the message ID. However, the destination message's
  700.       message ID field should, too, be set; when the contents of the MSGID
  701.       field are longer than what is supported by the destination format or
  702.       contain characters that should not be present there, a 32-bit CRC of
  703.       the contents of the MSGID field is taken. If an origination address
  704.       is needed, it is taken from the ORIGIN subfield.
  705.          When a message is gated *from* another message format, it is first
  706.       checked if the message contains a MsgID supplementary line; if so,
  707.       the MSGID contents are taken from there. Otherwise, the contents of
  708.       the origination message format's msgid field are taken. If the field
  709.       is in binary, each of the bytes it consists of should be converted to
  710.       a hexadecimal representation to produce a non-interrupted string of
  711.       hexadecimal digits, say "1af262b577de" for some 6-byte binary number.
  712.       If the origination address is a part of the origination message
  713.       format's message ID field, its 32-bit CRC in hexadecimal should be
  714.       appended to the already copied message ID without intervening data.
  715.  
  716.  
  717.  
  718.    SUBFIELD: REPLYID (simple) [don't take that too literally]
  719.    ID: 12
  720.    Presence: Zero or one
  721.  
  722.    Contains the contents of the MSGID subfield of the message this message
  723.    is a reply to; if the message is being converted from or to another
  724.    message format, the same conversion techniques apply as for the MSGID
  725.    subfield. This includes the usage of supplementary lines in cases
  726.    similar to those described for the MSGID subfield; however, for the
  727.    REPLYID subfield, not only a ReplyID, but also a ReplyAddr supplementary
  728.    line is used. The reason will soon be obvious.
  729.  
  730.    Consider the following in an OFT message:
  731.  
  732.       ^AMSGID: 2:380/121.512 2ffbea7f
  733.       ^AREPLY: 2:380/104.15 78024880
  734.  
  735.    When converted to EDX, it would read simply
  736.  
  737.       <MSGID>        2:380/121.512 2ffbea7f
  738.       <REPLYID>    2:380/104.15 78024880
  739.  
  740.    But when converted back to OFT, the REPLY subfield could not be
  741.    converted because the replied-to message's origination address is not
  742.    available. For that matter, the contents of the replied-to message's
  743.    MSGID subfield are followed by a NULL character and the origination
  744.    address of the replied-to message. The full format of the REPLYID
  745.    subfield, therefore, reads:
  746.  
  747.       <original message's ID>
  748.       <NULL>
  749.       <original message's origination E-Address>
  750.                                       =========
  751.  
  752.    Imagine the underlined "E-Address" string in block letters.
  753.  
  754.  
  755.    Now, when a message is generated by an OFT system, it has the MSGID of,
  756.    for example:
  757.       ^AMSGID: 2:380/104.15 78024880
  758.  
  759.    The string is then "converted" to EDX format, simply:
  760.       <MSGID> 2:380/104.15 78024880
  761.  
  762.    However, when the message is again converted to OFT format, the
  763.    following message ID is created:
  764.       ^AMSGID: ofs->FidoNet#2:380/104.15 <somenumber>
  765.    <somenumber> contains the 32-bit CRC of the contents of the MSGID
  766.    subfield that you can see 5 lines above. Of course, a MsgID supline is,
  767.    too, prepended prior to the message text:
  768.        &MsgID: 2:380/104.15 78024880
  769.    The reason that somewhere ofs->FidoNet#2:380/104.15 and somewhere just
  770.    2:380/104.15 is placed is that in the first case, the address was
  771.    obtained from the ORIGINADDRESS subfield (that was converted to EDX
  772.    format), while in the second case, the address is treated as a part of
  773.    the original message ID. You should be able to explain that on each
  774.    specific case.
  775.  
  776.  
  777.    Later, a reply is generated by another OFT system that has the *.ID pair
  778.    of, for example:
  779.       ^AMSGID: 2:380/121.512 2ffbea7f
  780.       ^AREPLY: 2:380/104.15 78024880
  781.  
  782.    When converted to EDX, it reads:
  783.  
  784.       <MSGID>        2:380/121.512 2ffbea7f
  785.       <REPLYID>    2:380/104.15 78024880
  786.                   <NULL>
  787.                   ofs->FidoNet#2:380/104.15
  788.  
  789.    Notice the original message's origination address after the REPLYID; it
  790.    is retrieved from the first part of the ^AREPLY kludge in the message
  791.    prior to its conversion.
  792.  
  793.    Now, when converted back to OFT:
  794.       ^AMSGID: ofs->FidoNet#2:380/121.512 <sthelse>
  795.       ^AREPLY: ofs->FidoNet#2:380/104.15 <somenumber>
  796.    Here, <somenumber> is the same number as it was a few steps before when
  797.    the original message's was converted back to OFT. This way, reply
  798.    linking is possible even when messages get gated multiple times.
  799.  
  800.    Of course, along with the ^AREPLY and ^AMSGID kludges created in the
  801.    last described step, MsgID and ReplyID supplementary lines are also
  802.    added to message text:
  803.        &MsgID: 2:380/121.512 2ffbea7f
  804.        &ReplyID: 2:380/104.15 78024880
  805.        &ReplyAddr: ofs->FidoNet#2:380/104.15
  806.  
  807.  
  808.  
  809.    SUBFIELD: TEXT (complex)
  810.    ID: 1000
  811.    Contents: text
  812.    Presence: Zero or one
  813.  
  814.    The TEXT subfield contains plain text. The smallest unit of text next
  815.    to a character and a word is, however, not a line, but a paragraph that
  816.    contains freely flowing text without intervening CR-s. A CR (ASCII 13)
  817.    is used to terminate a paragraph and start a new one. ASCII 141 (softCR)
  818.    is treated as a normal character.
  819.  
  820.    It is strongly recommended that, when displaying message text, lines of
  821.    minimally 78 characters in length be supported. When inserting ASCII art
  822.    in message text, this should ensure proper display of such messages on
  823.    as many systems as possible.
  824.  
  825.    Message text is not to exceed 128k in length. However, implementations
  826.    must be able to process all sizes of text up to that number of bytes.
  827.  
  828.    *Only actual message text* is allowed to be stored in the TEXT subfield.
  829.    Although it is allowed to treat the tearline and originline as a part of
  830.    message text when gating a message from OFT to EDX, it is not under any
  831.    circumstances allowed for an EDX-compliant piece of software to actually
  832.    generate any control information in the TEXT subfield. Such information
  833.    has its place in other subfields; if there isn't any place for it to
  834.    store, it shouldn't stored at all.
  835.  
  836.  
  837.  
  838.    SUBFIELD: FILE (complex)
  839.    ID: 1001
  840.    Contents: Two ulongs followed by two null-terminated strings
  841.              followed by unbounded data
  842.    Presence: Zero or more
  843.  
  844.    Contains information about an enclosed file and the file itself.
  845.  
  846.    The first ulong contains the size of the file; it must match the number
  847.    of bytes in the "unbounded data" field as said above.
  848.  
  849.    The second ulong contains the UTC date and time of file's last update,
  850.    in Unix format - the number of seconds since 00:00:00, 01-Jan-1970.
  851.  
  852.    The first string contains the short 8.3 filename consisting of
  853.    characters 'A'..'Z', '0'..'9', and "_-!#$&()", without the quotes;
  854.    treated case insensitive.
  855.  
  856.    The second string contains the full name of the file; any character from
  857.    ASCII 32..126, up to 255 characters. Should the full filename equal the
  858.    short one, the third and the second strings should be set to the same
  859.    values.
  860.  
  861.    The NULL that terminates the last of the above strings is immediately
  862.    followed by the contents of the file.
  863.  
  864.    Gating for networks that don't feature files attached to messages:
  865.       probably the best would be to move the uuencoded file's contents
  866.       to the message text.
  867.  
  868.    Gating for networks that feature file attaches: save attached files to
  869.       disk and attach them to the message. Use whatever format you wish
  870.       to store other information about the file in the message's text.
  871.       If the network format overwrites message's subject if files are
  872.       attached, save the subject to message text using the Subj supline.
  873.  
  874.  
  875.  
  876.    Passing a message
  877.    ========================================================================
  878.    When an application passes an EDX message it has received from somewhere
  879.    to another system using the EDX format again, the only data it is
  880.    allowed (*and* required) to change are the TRACE and SENTTO subfields.
  881.    See the format of the two subfields for further information.
  882.  
  883.  
  884.  
  885.    Colors, fonts, inserted pictures, sound and whistles
  886.    ========================================================================
  887.    EDX currently supports none of the above, the reason being that the
  888.    number of complications all of the above would make highly exceeds its
  889.    usability. If time proves the opposite, a special "FORMAT" subfield
  890.    will be implemented that will dictate how to interpret message text,
  891.    implementing all of the above and still staying backwardly compatible.
  892.  
  893.    Implementation of all this is relatively simple for message processors,
  894.    while it complicates the message editor authors' lifes. I invite all
  895.    authors of public mail editors to send me a message if they would like
  896.    to implement GUI elements in their programs; if enough of us happens to
  897.    gather up, we will produce specifications for the FORMAT subfield and a
  898.    special msgbase format will be developed, most probably an extension to
  899.    JAM (as it is the most flexible messagebase format present at the
  900.    moment), to support this.
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.    ========================================================================
  908.    EDX message text supplements
  909.    ========================================================================
  910.    Those EDX implementations that are expected to convert messages between
  911.    EDX and some other format can make use of message text supplementary
  912.    lines when a message's information would otherwise be lost in a non-EDX
  913.    format.
  914.  
  915.    Note that EDX supplementary lines, however contradictory it may seem,
  916.    are under no condition to be used in EDX, but in message formats that
  917.    place control information in the message text and do not have (enough)
  918.    space reserved for some information the message carried prior to being
  919.    converted from EDX into that format. Also, for information for which
  920.    there is sufficient space in the converted-to message format, no
  921.    supplementary lines should be created; for example, there should be no
  922.    Creator or Exporter supplementary lines in OFT Type-2 messages.
  923.  
  924.    Supplementary line format is, exactly:
  925.       <" &"><linetag><": "><data><EOL>
  926.    where:
  927.       <linetag> is the tag of the supplementary line (case sensitive)
  928.       <data> consists of ASCII characters 32-126
  929.       <EOL> is converted-to message format specific end-of-line terminator,
  930.          for instance <CR> for FTS-1, <CRLF> for RFC-822 etc.
  931.  
  932.    A supplementary line must not exceed 79 characters.
  933.  
  934.    All supplementary lines are appended just prior to original message
  935.    text. They are separated from it with an empty line, unless an empty
  936.    line is impossible to insert in the converted-to message format.
  937.  
  938.    When a message with supplementary lines is converted (back) to EDX, the
  939.    below-defined supplementary lines should be converted to their subfield
  940.    representation. Unknown supplementary lines should be left untouched.
  941.  
  942.    Note that supplementary lines should be treated as a part of message
  943.    text equal to the text itself; they are human readable, only their
  944.    format is such that also a program can read them. Therefore, it is
  945.    natural, for example, to store EDX supplementary lines after the SOT
  946.    and before the EOT kludge in OFT messages.
  947.  
  948.  
  949.  
  950.    MsgID
  951.       " &MsgID: <text><EOL>"
  952.    Contains the contents of the MSGID subfield. (See MSGID subfield)
  953.  
  954.  
  955.    ReplyID
  956.       " &ReplyID: <text><EOL>"
  957.    Contains the contents of the REPLYID subfield up to, but excluding the
  958.    NULL character. (See REPLYID subfield)
  959.  
  960.  
  961.    ReplyAddr
  962.       " &ReplyAddr: <text><EOL>"
  963.    Contains the contents of the REPLYID subfield from, but excluding the
  964.    NULL character. (See REPLYID subfield)
  965.  
  966.  
  967.    Creator
  968.       " &Creator: <text><EOL>"
  969.    Contains the contents of the CREATOR subfield should nothing equivalent
  970.    be featured by the converted-to message format.
  971.  
  972.  
  973.    Exporter
  974.       " &Exporter: <text><EOL>"
  975.    Contains the contents of the EXPORTER subfield should nothing equivalent
  976.    be featured by the converted-to message format.
  977.  
  978.  
  979.    Origin
  980.       " &Origin: <name>, <E-Address><EOL>"
  981.    Contains the name and address of the actual message sender if the
  982.    converted-to message format cannot (safely) hold their entire name or
  983.    address as it was originally.
  984.       In OFT messages, the Origin supplementary line is always written.
  985.  
  986.  
  987.    Dest
  988.       " &Dest: <E-Address><EOL>"
  989.    For netmail (and equivalent) messages only: contains the address of the
  990.    system to route the message to if the converted-to message format cannot
  991.    (safely) hold the entire address.
  992.       In OFT netmail messages, this supplementary line is always written.
  993.  
  994.  
  995.    Author
  996.       " &Author: <name>, <E-Address><EOL>"
  997.    Contains the name of one of the message's authors if the converted-to
  998.    message format doesn't support anything parallel to the AUTHOR subfield.
  999.    One line is used for each author, *all* authors should be specified.
  1000.  
  1001.  
  1002.    Whoto
  1003.       " &Whoto: <name><EOL>"
  1004.    Contains the name of one of the message's recipients if there are more
  1005.    than the converted-to message's format supports. One line is used for
  1006.    each recipient, *all* recipients should be specified. The Whoto line
  1007.    only applies to echoed messages; for netmail messages, multiple copies
  1008.    of the original message should be created.
  1009.  
  1010.  
  1011.    Subject
  1012.       " &Sbj: <text><EOL>"
  1013.    Contains the entire message's subject if there is not enough space for
  1014.    it in the converted-to message format.
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025. The following chapter is independent from the EDX specifications. It is a
  1026. recommendation for an integrator between EDX and other specifications, and
  1027. should, indeed, be placed in some file by itself. Don't worry, it'll be as
  1028. it evolutes.
  1029.  
  1030.    ========================================================================
  1031.    EDX Recommendations
  1032.    ========================================================================
  1033.    The following are implementation recommandations intended to avoid chaos
  1034.    of different, non-inter-operable EDX implementations. In order to
  1035.    achieve that goal, each developer is highly encouraged to develop their
  1036.    software having them in mind.
  1037.  
  1038.    "ERX" is an abbreviation for "EDX Recommendations". ERX does *not* equal
  1039.    EDX; if one decides to implement EDX, they aren't bound to also follow
  1040.    the ERX specifications. However, for cases described herein, it is
  1041.    highly desireable that these specifications, too, be followed.
  1042.  
  1043.    In Fidonet, for example, common practice has been to separate the system
  1044.    into two major parts, the mailer and the tosser, where the mailer
  1045.    formally operates the level 3 layer and the tosser formally operates the
  1046.    level 4 layer. But in reality, the tasks are commonly mixed up; the
  1047.    program referred to as the mailer does things that belong to the fourth
  1048.    layer (call scheduling, for example), and still these functions are
  1049.    called the property of the mailer. Newer software, though, would use a
  1050.    different approach: there would be a single central system coordinating
  1051.    module (the "tosser") whose task would be to process mail and schedules,
  1052.    and that module would use the lower-laying modules ("mailers") to
  1053.    perform mail sessions.
  1054.  
  1055.    While these modules are kept in the same executable, there's no real
  1056.    problem exchanging data between them. But in reality, this cannot be
  1057.    the case for full-fledged packages; and, frequently, two modules used
  1058.    are not necessarily from the same author. The most practical way to
  1059.    exchange data between them is, then, through the underlying operating
  1060.    system's file system.
  1061.  
  1062.    The session module needs the following data be sent to it by the
  1063.    controlling module:
  1064.       * has the session been initiated locally or remotely
  1065.       * the protocols that should be taken in consideration when
  1066.         attempting to initialize the session, in descending order
  1067.       * the list of mail and requests to be sent to the remote
  1068.  
  1069.    Of course, the above short list contains nothing that could not be
  1070.    specified to the session handler on the command line when an outbound
  1071.    session is established. The problem is in the mail list when somebody
  1072.    else called in; with incomming sessions, there is no way to tell who it
  1073.    is that is attempting the connection before the session has already been
  1074.    established. That's why the session module should have some means to
  1075.    scan through the entire list of mail to be sent to all systems and pick
  1076.    out those destinated to the current partner-in-session.
  1077.  
  1078.  
  1079.  
  1080.    Recommended in-transit mail storage
  1081.    ========================================================================
  1082.    As stated above, probably the optimal way to exchange data between
  1083.    modules is the underlying file system. When the mail is stored in files
  1084.    (mail for separated systems in separated files, of course), there are,
  1085.    basically, two ways of storing it: unchanged or changed. When it is
  1086.    unchanged, it is assumed that the file contains an arbitrary number of
  1087.    mail items; see below for a definition of such a format. The only
  1088.    reasonable way to change the mail packets, on the other hand, is to
  1089.    compress or encrypt them. Therefore, we need three types of files we
  1090.    would be able to tell from each other just by checking the filenames.
  1091.  
  1092.    Encrypted packets aren't covered in ERX.
  1093.  
  1094.    Adding mail packets to files containing unchanged mail is relatively
  1095.    easy. On the other hand, with compressed mail, one would have to
  1096.    unpack the file, add the mail packets, and recompress it; a relatively
  1097.    major pain in the ass. That's why compressed mail containers contain
  1098.    a variable number of uncompressed mail container files, which can then
  1099.    be quickly added another when necessary.
  1100.  
  1101.    ERX defines no standard mail compressing protocol; it is up to the
  1102.    implementation to scan the compressed mail container for a format ID
  1103.    and run the appropriate decompression module, be it ZIP, ARJ, LHA or
  1104.    whatever.
  1105.  
  1106.    For uncompressed mail containers, the naming convention is:
  1107.       <somethng>.ERX
  1108.  
  1109.    while for compressed mail containers, it is:
  1110.       <somethng>.EC<n>
  1111.  
  1112.    <somethng> consists of exactly 8 *hex* digits. ('0'..'9', 'A'..'F')
  1113.    <n> is a number in base 36 (0..9, A..Z) - described a paragraph or two
  1114.    below. The names are case insensitive.
  1115.  
  1116.    Naming algorythm: the contents of <somethng> generally don't matter,
  1117.    but however, for compressed mail containers, an optimal algorythm
  1118.    would compute the 32-bit CRC of our address and the address of the
  1119.    system the file is destinated to, while for uncompressed containers,
  1120.    the algorythm would be simply to make <somethng> a number that is
  1121.    incremented each time a new uncompressed mail container is created for
  1122.    a specific system.
  1123.  
  1124.    <n> comes to use when a parallel task wants to store new compressed
  1125.    mail for a system when that particular system is just on-line and
  1126.    receiving its mail; then, a new compressed file is created with a
  1127.    higher value of <n>.
  1128.  
  1129.    Note that there is a catch with processing received mail. No one
  1130.    guarranties that two uncompresed mail containers from two separate
  1131.    systems will have a different name. Therefore, when raw uncompressed
  1132.    mail containers are received, care should be taken to rename them in
  1133.    the event of a name clash, and when compressed mail containers are
  1134.    received, only one at a time should be unpacked and processed.
  1135.  
  1136.    Also note that the names of files when received on the destination
  1137.    system need not match the filenames as they were on the origination
  1138.    system. In the event of name clash, implementations are allowed, indeed,
  1139.    expected to rename the files as appropriate.
  1140.  
  1141.  
  1142.  
  1143.    Format of the above mentioned uncompressed mail containers
  1144.    ========================================================================
  1145.    An uncompressed mail container (a packet) consists of a binary header
  1146.    and an arbitrary number of mail items; for now, EDX messages. For the
  1147.    sake of upgradeability, each item is preceded with a 4-byte unsigned
  1148.    long integer representing its length in bytes and a 4-byte unsigned long
  1149.    integer representing the type of the item in order to allow
  1150.    implementations of lower EDX levels to skip items they do not know about
  1151.    in the possible future.
  1152.  
  1153.    Uncompressed mail containers are protected using envelopes that
  1154.    optionally include password protection. An envelope is a 32-bit value
  1155.    that is used to check packet's authenticity.
  1156.  
  1157.    For non-password-protected packets, the envelope is simply the 32-bit
  1158.    CRC of all data beyond packet header. For password-protected packets,
  1159.    however, the procedure is a bit longer.
  1160.  
  1161.    In the latter case, the first part of computing a packet's envelope is
  1162.    to generate the packet's key: a 32-bit CRC, a 32-bit checksum and a
  1163.    16-bit CRC of all data beyond the packet's header are computed. The
  1164.    checksum is a 32-bit value that represents the sum of all bytes the
  1165.    mentioned data consists of. The 32-bit CRC is the one used in ZModem,
  1166.    the 16-bit CRC is the one used in XModem. When the three values are
  1167.    computed, they are copied into an array of 10 bytes that represents the
  1168.    packet's key, first the 32-bit CRC (4 bytes), then the checksum (ditto),
  1169.    then the 16-bit CRC (2 bytes). Then, the packet's password is encrypted
  1170.    with the resulting key, and the 32-bit CRC of the resulting encrypted
  1171.    password is the packet's envelope. The encryption algorythm is:
  1172.       newdata[i] = origdata[i] * thekey[(i MOD sizeof(thekey))]
  1173.    The arrays newbyte, origbyte and thekey are assumed zero-based. The
  1174.    newdata and origdata arrays are assumed to have the same size. The i
  1175.    variable is assumed to have the range of 0..[origdatalength-1].
  1176.  
  1177.    If there is no data following the packet's header, the envelope should
  1178.    be set to -1 (0xffffffff).
  1179.  
  1180.    The packet's envelope is checked by computing a separate version of the
  1181.    envelope and comparing it to the envelope that is stored in the packet's
  1182.    header.
  1183.  
  1184.  
  1185.    Header structure:
  1186.       char  signature[4]       // 'E', 'R', 'X', ASCII 0
  1187.       ulong hdrsize            // Size of the packet's header in bytes
  1188.       ulong envelope           // Packet's envelope, see above
  1189.       char  origaddress[101]   // Null-terminated origin E-Address
  1190.       char  destaddress[101]   // Null-terminated dest E-Address
  1191.       char  creatorprog[51]    // The program that created the *packet*
  1192.  
  1193.    The size of the packet header may increase in future ERX levels higher
  1194.    than 1. However, future packet headers will stay compatible with ERX
  1195.    level 1; an ERX implementation is, when implementing packets as
  1196.    described in here, expected to be able to process all revisions of the
  1197.    packet header with the help of information stored in hdrsize.
  1198.  
  1199.    The signature field *must* match 'E', 'R', 'X', NULL in order for the
  1200.    packet to be processed. The comparison of 'E', 'R' and 'X' should be
  1201.    performed exactly - case sensitively.
  1202.  
  1203.    The origaddress and destaddress fields specify the origination and
  1204.    destination addresses of the packet, *not* the messages in it. Since
  1205.    the ERX packet is a temporary structure created and known only between
  1206.    two directly connected systems and is not to be routed, a destaddress
  1207.    would normally not be needed, but is present if the packet ends on a
  1208.    different system from the one it was destined to.
  1209.  
  1210.    The creatorprog field contains a banner for the program that created the
  1211.    *packet* (not the messages in it), say: "MailMangle v1.24 build376".
  1212.    Only characters in the range of ASCII 32..126 are allowed.
  1213.  
  1214.  
  1215.    The header is followed by zero or more items (for now messages only),
  1216.    each preceded with the following structure:
  1217.       ulong itemtype
  1218.       ulong itemlen
  1219.  
  1220.    itemtype 0 stands for a message; no other values have been defined as
  1221.    of yet. If an unknown itemtype field is encountered, the item should be
  1222.    skipped.
  1223.  
  1224.  
  1225.    Coexistance of ERX packets with Old FidoNet Technology Type-2+ packets
  1226.    ========================================================================
  1227.    When an ERX implementation sends mail to a system using OFT Type-2+
  1228.    packets, it should signify the availability of ERX by setting the
  1229.    Capability Word as if it would support Type-16 packets; that is, the
  1230.    14th bit of CW (starting from 0 = 0x01) is set to 1. The CWValidation
  1231.    field should, of course, be set accordingly to the generated CW.
  1232.  
  1233.  
  1234.    Coexistance of ERX packets with Old FidoNet Technology Type-2 packets
  1235.    ========================================================================
  1236.    When sending mail to a system using OFT Type-2 packets as described in
  1237.    FTS-1 r15, a Type-2+ header is generated instead of a raw Type-2 one,
  1238.    and the CW and CWV fields are used as described above.
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.    Recommended mail list format
  1248.    ========================================================================
  1249.    The recommended mail list format consists of the main data file and the
  1250.    index file, named <basename>.MLD and <basename>.MLX, respectively.
  1251.    <basename> should be user-definable.
  1252.  
  1253.    Note that the mail list base is not used as an in-between between a
  1254.    tosser and a mailer as used in, for example, FidoNet, but between the
  1255.    program that already established a mail connection and the program that
  1256.    is actually performing mail transfer. Therefore, the use of this type of
  1257.    mail list has no meaning with traditional mailers like FrontDoor or
  1258.    BinkleyTerm.
  1259.  
  1260.    All applications should open the mail list files in shareable (DENYNONE)
  1261.    read/write or readonly mode. An exception is granted to maintenance
  1262.    utilities, which should open the mail list files in exclusive, DENYALL
  1263.    sharing mode.
  1264.  
  1265.    If a normal application (ie, not a maintenance utility) attempts to
  1266.    write to the mail list, it must first attempt to lock the first byte of
  1267.    the data file. The application should under no circumstances attempt to
  1268.    write to the mail list if it could not lock the data file. The program
  1269.    should, after successfully locking the mail list, write what it has to
  1270.    write as quickly as possible and then release the lock.
  1271.  
  1272.  
  1273.  
  1274.    The data file
  1275.    =============
  1276.    The data file consists of a 1024-byte binary header, followed by
  1277.    subfields of base type, each listing a file or a request and its
  1278.    destination. The binary header format is:
  1279.       char hrsig[30]
  1280.  
  1281.    The hrsig field contains the following human readable signature:
  1282.    "Mail list data file (binary)", followed by #26 (^Z), followed by
  1283.    the terminating null.
  1284.  
  1285.    The rest of the data file is built of base subfields.
  1286.  
  1287.    Subfield IDs are somewhat peculiar: they are used to hold special
  1288.    attributes of the mail item. The first 16 bits (0..15) are used as
  1289.    a part of the normal ID, while the other 16 (16..31) have special
  1290.    meanings that depend on the type of subfield. This all is equivalent
  1291.    to splitting the subfield ID in half and naming the second half
  1292.    "subfield attributes" instead. The unused attribute bits should be
  1293.    set to zero when writing the field to the file.
  1294.  
  1295.    The maximum length of any given subfield is 512 bytes.
  1296.  
  1297.  
  1298.    SUBFIELD: FILE
  1299.    ID, low 16 bits: 0
  1300.    ID, high 16 bits:
  1301.       31:   If set the file should only be sent on inbound connections with
  1302.             the specified system. If not set, the file should be sent on
  1303.             outbound connections as well.
  1304.       30:   If set, the file contains ERX mail, no matter what its filename.
  1305.       29:   If set, the file contains OFT mail, no matter what its filename.
  1306.             If bit 30 is set, bit 29 should be ignored. If neither bit 30
  1307.             nor 29 are set, the file is assumed normal.
  1308.       28:   If set in combination with 30 or 29, the mail is stored in raw,
  1309.             unmodified (compressed, encrypted) packets; otherwise ignored.
  1310.       27:   If set, the file should be deleted after it is sent in its
  1311.             entirety.
  1312.       26:   If set, file's size should be set to zero after it is sent in
  1313.             its entirety. If bit 27 is set, too, this bit should be ignored
  1314.             and bit 27 honored.
  1315.    Contents: Two null-terminated strings
  1316.  
  1317.    The first string specifies the E-Address of the system the subfield
  1318.    applies to, while the second string specifies a file to be transfered
  1319.    to that system. Exactly one file per subfield can be specified.
  1320.  
  1321.    The maximum length of the first string is 100 characters. The maximum
  1322.    length of the second string is 255 characters.
  1323.  
  1324.  
  1325.    SUBFIELD: REQUEST
  1326.    ID, low 16 bits: 1
  1327.    ID, high 16 bits: undefined. (Zeroed)
  1328.    Contents: two or three null-terminated strings
  1329.  
  1330.    The first string specifies the E-Address of the system the subfield
  1331.    applies to, while the second string specifies the filename to
  1332.    request from the remote system. Wildcards are allowed. Should a password
  1333.    be required, it should be specified in the third string. If the second
  1334.    strings contains a full path and filename, it is to be treated as an
  1335.    update request. Exactly one request per subfield can be specified.
  1336.  
  1337.    The maximum length for the first and third (optional) string is 100
  1338.    characters. The maximum length for the second string is 255 characters.
  1339.  
  1340.  
  1341.    SUBFIELD: TEST
  1342.    ID, low 16 bits: 65535
  1343.    ID, high 16 bits: depends on implementation
  1344.    Contents: A null-terminated string and undefined data
  1345.  
  1346.    Intented for various experiments, this subfield contains one
  1347.    null-terminated string specifying the program that is making the
  1348.    experiments, followed by that program specific data. When another
  1349.    program's (= unknown) TEST subfield is encountered, it should be
  1350.    ignored.
  1351.  
  1352.  
  1353.  
  1354.    The index file
  1355.    ==============
  1356.    The mail list index file is built of a binary header and an arbitrary
  1357.    number of binary records. The binary header format is:
  1358.       char hrsig[31]
  1359.  
  1360.    The hrsig field contains the following human readable signature:
  1361.    "Mail list index file (binary)", followed by #26 (^Z), followed by the
  1362.    terminating null.
  1363.  
  1364.    Each binary record corresponds to a subfield in the mail list data file.
  1365.    The binary record format is:
  1366.       ulong addresscrc
  1367.       ulong subfpos
  1368.       ulong subfid
  1369.  
  1370.    Where addresscrc specifies the 32-bit CRC of the E-Address used by the
  1371.    subfield; equals -1 if the subfield is not of a type that would contain
  1372.    a single E-Address (no such mail list data file subfield is defined as
  1373.    of yet), subfpos specifies the absolute position of the subfield in the
  1374.    data file and subfid specifies the ID of the subfield.
  1375.  
  1376.  
  1377.  
  1378.    Subfield deleting
  1379.    =================
  1380.    When a subfield is processed (ie, a file is sent or a request is made),
  1381.    it should be deleted. Since it would be rather awkward to actually
  1382.    delete the subfield, it is done so that all the fields of the respective
  1383.    subfield's index record are set to -1 and the subfield's ID in the data
  1384.    file is set to -1.
  1385.  
  1386.    Actual physical deletion of subfields is left to some sort of a packing
  1387.    program as used by similar data bases.
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.    Recommended logical connection layer standard
  1395.    ========================================================================
  1396.    I stick to the rule that any network layer should cooperate with as
  1397.    many other different network layers as possible, and that's why I
  1398.    leave it to the network that is about to implement EDX to decide which
  1399.    first, second and third layers to use. FTN networks will probably want
  1400.    to stay with (or upgrade to) EMSI and Hydra.
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411.    ========================================================================
  1412.    Evolution considerations
  1413.    ========================================================================
  1414.    As EDX evolutes, care will be taken for each higher level of EDX to be
  1415.    a superset of the prior versions, so that a higher-level program will
  1416.    be able to process lower-level EDX packets without even having to know
  1417.    that they are from a level lower than the highest supported. Also, a
  1418.    lower-level program will be able to process higher-level EDX packets
  1419.    as long as it ignores unknown subfields and subfields; also, in binary
  1420.    or string structures, it should ignore all extra data out of the known
  1421.    structures, so that lower-level software won't choke on a packet if a
  1422.    new substring is added to, say, string 2 of the SYSINFO subfield.
  1423.    However, a lot of information would be lost with such superset-to-
  1424.    subset conversions; therefore, a received mail packet should (=must)
  1425.    be passed to downlinks with all locally unknown information included,
  1426.    with only the known fields updated, if necessary. I still do, of
  1427.    course, strongly encourage everyone, especially sites with many direct
  1428.    or indirect downlinks, to use as recent software as possible.
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.    ========================================================================
  1440.    Considerations on upgrading from and coexisting with other mail formats
  1441.    ========================================================================
  1442.    Mail format coexistance is often required for a big network to be able
  1443.    to upgrade itself smoothly to a new and better mailing technology.
  1444.    Generally, the implementation is such that when sending mail to another
  1445.    system, the application puts somewhere a sign about other mail formats
  1446.    it supports; this sign is, naturally, not defined in the specifications
  1447.    of the mail format the sign is in, but rather in the specifications of
  1448.    the mail format the sign stands for. If the destination system also
  1449.    supports the "signed" mail format, it uses it next time when sending
  1450.    mail to the system that sent the sign. When that system receives mail in
  1451.    the new format, it too switches to it next time it sends mail back.
  1452.  
  1453.    Note that, when converting a message to EDX format, each piece of
  1454.    information should only be converted if and only if:
  1455.       a) An official supplement has been added to EDX explaining how
  1456.          and if that information should be stored in EDX
  1457.    or b) EDX already has space defined to store that information;
  1458.          for example, the contents of the OFT MSGSEQ kludge should
  1459.          be stored in the seqno header field.
  1460.    or c) The official standard describing that information contains
  1461.          instructions how to store the information in EDX messages.
  1462.  
  1463.    The exact instructions as present in either of the above cases should
  1464.    be followed. Instructions in an official EDX supplement have precedence
  1465.    over original EDX specifications, while the original EDX specifications
  1466.    have precedence over instructions made by a third party as described in
  1467.    the third case. That means that if someone invents a great new WhizBang
  1468.    mail format and says that message sequential number information should
  1469.    be stored in an additional subfield, that information should regardless
  1470.    of that be stored in the appropriate field in the message header.
  1471.  
  1472.    If none of the above described cases in which information can be stored
  1473.    in an EDX message applies, please contact me - either privately, through
  1474.    E-Mail or snailmail, or through the FidoNet Net_Dev echo. All proposals
  1475.    are welcome.
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486. /// EOF */
  1487.